home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 July: Mac OS SDK / Dev.CD Jul 96 SDK / Dev.CD Jul 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc Development Framework / ODFDev / Draw / Sources / GroupCmd.h < prev    next >
Encoding:
Text File  |  1996-04-25  |  2.9 KB  |  113 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                GroupCmd.h
  4. //    Release Version:    $ ODF 1 $
  5. //
  6. //    Author:                Mary Boetcher
  7. //
  8. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  9. //
  10. //========================================================================================
  11.  
  12. #ifndef GROUPCMD_H
  13. #define GROUPCMD_H
  14.  
  15. // ----- FrameWork Includes -----
  16.  
  17. #ifndef CONTENT_H
  18. #include "Content.h"
  19. #endif
  20.  
  21. #ifndef FWCMD_H
  22. #include "FWCmd.h"
  23. #endif
  24.  
  25. //========================================================================================
  26. //    Forward Declarations
  27. //========================================================================================
  28.  
  29. class FW_CFrame;
  30. class CDrawSelection;
  31. class CDrawContent;
  32. class CGroupShape;
  33. class CShapeCollection;
  34.  
  35. //========================================================================================
  36. // class CGroupContent
  37. //========================================================================================
  38.  
  39. class CGroupContent : public CDrawContent
  40. {
  41.   public:
  42.  
  43.     FW_DECLARE_AUTO(CGroupContent)
  44.     
  45.     CGroupContent(Environment* ev, CDrawContent* other);
  46.     virtual ~CGroupContent();
  47.  
  48.     CShapeCollection* GetShapeList();
  49. };
  50.  
  51. //========================================================================================
  52. // class CGroupShapesCommand - combine selected shapes into one group shape
  53. //========================================================================================
  54.  
  55. class CGroupShapesCommand : public FW_CCommand
  56. {
  57.   public:
  58.  
  59.     FW_DECLARE_AUTO(CGroupShapesCommand)
  60.     
  61.     CGroupShapesCommand(Environment* ev, 
  62.                         FW_CFrame* frame, 
  63.                         CDrawSelection* selection);
  64.     virtual ~CGroupShapesCommand();
  65.  
  66.     virtual void DoIt(Environment* ev);
  67.     virtual void UndoIt(Environment* ev);
  68.     virtual void RedoIt(Environment* ev);
  69.  
  70.     virtual void CommitUndone(Environment* ev);
  71.  
  72.   private:
  73.     void GroupShapes(Environment* ev);
  74.  
  75.   private:
  76.     CDrawSelection*    fDrawSelection;
  77.     CGroupShape*    fGroupShape;
  78.     CGroupContent*    fGroupedContent;
  79. };
  80.  
  81. //========================================================================================
  82. // class CUngroupShapesCommand - ungroup selected shapes, if any are grouped
  83. //========================================================================================
  84.  
  85. class CUngroupShapesCommand : public FW_CCommand
  86. {
  87.   public:
  88.  
  89.     FW_DECLARE_AUTO(CUngroupShapesCommand)
  90.     
  91.     CUngroupShapesCommand(Environment* ev, 
  92.                           FW_CFrame* frame, 
  93.                           CDrawSelection* selection);
  94.     virtual ~CUngroupShapesCommand();
  95.  
  96.     virtual void DoIt(Environment* ev);
  97.     virtual void UndoIt(Environment* ev);
  98.     virtual void RedoIt(Environment* ev);
  99.  
  100.     virtual void CommitDone(Environment* ev);
  101.  
  102.   private:
  103.     void UngroupShape(Environment* ev, CGroupShape* groupShape);
  104.     void RegroupShape(Environment* ev, CGroupShape* groupShape);
  105.  
  106.   private:
  107.     CDrawSelection*        fDrawSelection;
  108.     CShapeCollection*    fGroupList;        // list of CGroupShape*
  109. };
  110.  
  111.  
  112. #endif
  113.